package com.yazi.mxz.behavior.repository;


import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.geo.Point;
import org.springframework.data.mongodb.repository.MongoRepository;

import com.yazi.mxz.behavior.entity.repository.StoreGoodsAccess;
import com.yazi.mxz.behavior.entity.repository.StoreGoodsAccessId;

public interface StoreGoodsAccessRepository extends MongoRepository<StoreGoodsAccess, StoreGoodsAccessId> {
	
	/**
	 * 获取某个cookie用户最近浏览的商品
	 * @param cookie
	 * @param pageable
	 * @return
	 */
	List<StoreGoodsAccess> findById_CookieOrderByAccessTimeDesc(Long cookie, Pageable pageable);
	/**
	 * 获取某个点附近最近浏览的商品
	 * @param location
	 * @param pageable
	 * @return
	 */
	List<StoreGoodsAccess> findStoreGoodsDistinctByLocationNearOrderByAccessTimeDesc(Point location, Pageable pageable);
}
